﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpenseSystem.Common;
using ExpenseSystem.Common.BaseModel;
using ExpenseSystem.DataUpdater;
using ExpenseSystem.Fether;
using ExpenseSystem.Model;
using ExpenseSystem.Core.DataAddOn;
using System.Web;

namespace ExpenseSystem.Core.ProductionModules
{
    public class BlandManager : INormalManager<BlandModel>
    {
        protected string tran = HttpContext.Current.Items[Definition.SESSION_TRAN_STR].ToString();

        UserProfile userProfile = Authority.Authority.GetUserProfile();
        BlandFetcher fetcher = new BlandFetcher();
        protected NormalDataUpdater<BlandModel> blandUpdater = new BlandUpdaterRegister().GetBlandUpdater();

        public virtual bool Delete(BlandModel role,  out string message)
        {

            bool result = blandUpdater.Remove(role, tran, fetcher, out message);
            return result;
        }
        public virtual bool DeleteById( long[] blandId, out string message)
        {

            bool result = true;
            result = blandUpdater.RemoveById(userProfile.SiteId, blandId, tran, fetcher, out message);
            return result;
        }
        public virtual bool Save(BlandModel bland,  out string message, params IAddable<BlandModel>[] addables)
        {
            return blandUpdater.Save(bland, tran, fetcher, out message);
        }

    }
}
